
package com.nbst;

import com.nbst.db.config.ErpDBConfig;
import com.nbst.db.config.MesDBConfig;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 
 * @ClassName: Application MES
 * @Description: 项目启动类(项目脚手架已升级为SpringBoot 2.0,JDK版本最低要求11及以上)
 * @author King
 * @date 2018-8-24
 * 
 */
@SpringBootApplication
@EnableTransactionManagement
@EnableScheduling // 开启定时任务
@ComponentScan("com.nbst")
@EnableConfigurationProperties(value = { ErpDBConfig.class, MesDBConfig.class })
public class Application extends SpringBootServletInitializer {

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Application.class);
	}

	public static void main(String[] args) {
		// 启动Spring Boot项目的唯一入口
		SpringApplication springApplication = new SpringApplication(Application.class);
		springApplication.addListeners(new ApplicationStartup());
		SpringApplication.run(Application.class, args);
	}
}
